package divingBoard;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

public class Solution {
    public int[] divingBoard(int shorter, int longer, int k) {
        // k1*shorter + (k-k1)*longer
        if(k == 0){
            return new int[0];
        }
        if(shorter == longer){
            return new int[]{k*shorter};
        }
        int[] ans = new int[k+1];
        for (int i = 0; i < ans.length; i++) {
            ans[i] = i*longer+(k-i)*shorter;
        }
        return ans;
    }
}
